# -*- coding: utf-8 -*-
import scrapy


class YzkSpider(scrapy.Spider):
    name = 'yzk'
    allowed_domains = ['dy2018.com']
    start_urls = ['https://www.dy2018.com/html/gndy/dyzz/index.html']

    def parse(self, response):
        yield scrapy.Request(
            url=response.url,
            callback=self.parse_index,
            dont_filter=True,
            meta={},
        )

    def parse_index(self, response):
        table_list = response.xpath('//div[@class="co_content8"]/ul/td/table')
        for table in table_list:
            movie_title = table.xpath('tr/td/b/a/@title').extract_first('名字为空')
            print(movie_title)



